Browse Source

Refactor code structure for improved readability and maintainability

main
Cailean 4 weeks ago
parent
commit
65642e2f6e
  1. 0
      bin/data/text/old/MacbethOld.json
  2. 0
      bin/data/text/old/contemp-macbeth.json
  3. 1210
      bin/data/text/old/preprocess_original.json
  4. 1866
      bin/data/text/old/preprocess_original_.json
  5. 1626
      bin/data/text/preprocess_contemporary.json
  6. 480
      bin/data/text/preprocess_original.json
  7. 4
      src/ofTeleprompter.h
  8. 8
      src/onxProcess.cpp
  9. 1
      src/onxProcess.h

0
bin/data/text/Macbeth.json → bin/data/text/old/MacbethOld.json

0
bin/data/text/contemp-macbeth.json → bin/data/text/old/contemp-macbeth.json

1210
bin/data/text/old/preprocess_original.json

File diff suppressed because it is too large

1866
bin/data/text/old/preprocess_original_.json

File diff suppressed because it is too large

1626
bin/data/text/preprocess_contemporary.json

File diff suppressed because it is too large

480
bin/data/text/preprocess_original.json

@ -1,4 +1,28 @@
[
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[An open Place.]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Thunder and Lightning]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Thunder and Lightning]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Enter three witches]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Enter three witches]",
"first_emotion": "neutral",
"resp_speaker": "FIRST WITCH.",
"resp_text": "When shall we three meet again? In thunder, lightning, or in rain?",
"resp_emotion": "neutral"
},
{
"first_speaker": "FIRST WITCH.",
"first_text": "When shall we three meet again? In thunder, lightning, or in rain?",
@ -51,6 +75,14 @@
"first_speaker": "ALL.",
"first_text": "Fair is foul, and foul is fair: Hover through the fog and filthy air. [Witches vanish.]",
"first_emotion": "disgust",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[A heath]",
"resp_emotion": "disgust"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[A heath]",
"first_emotion": "disgust",
"resp_speaker": "MACBETH",
"resp_text": "So foul and fair a day I have not seen.",
"resp_emotion": "disgust"
@ -244,12 +276,12 @@
"first_text": "Oftentimes to win us to our harm, the instruments of darkness tell us truths; Win us with honest trifles, then betray us in deepest consequence. - Cousin, a word, I pray you.",
"first_emotion": "fear",
"resp_speaker": "MACBETH",
"resp_text": "Aside.] This supernatural soliciting cannot be ill; cannot be good: - if ill, why hath it given me earnest of success, commencing in a truth? I am Thane of Cawdor: If good, why do I yield to that suggestion whose horrid image doth unfix my hair, and make my seated heart knock at my ribs against the use of nature?",
"resp_text": "[Aside.] This supernatural soliciting cannot be ill; cannot be good: - if ill, why hath it given me earnest of success, commencing in a truth? I am Thane of Cawdor: If good, why do I yield to that suggestion whose horrid image doth unfix my hair, and make my seated heart knock at my ribs against the use of nature?",
"resp_emotion": "fear"
},
{
"first_speaker": "MACBETH",
"first_text": "Aside.] This supernatural soliciting cannot be ill; cannot be good: - if ill, why hath it given me earnest of success, commencing in a truth? I am Thane of Cawdor: If good, why do I yield to that suggestion whose horrid image doth unfix my hair, and make my seated heart knock at my ribs against the use of nature?",
"first_text": "[Aside.] This supernatural soliciting cannot be ill; cannot be good: - if ill, why hath it given me earnest of success, commencing in a truth? I am Thane of Cawdor: If good, why do I yield to that suggestion whose horrid image doth unfix my hair, and make my seated heart knock at my ribs against the use of nature?",
"first_emotion": "fear",
"resp_speaker": "BANQUO",
"resp_text": "Look, how our partner's rapt.",
@ -299,6 +331,30 @@
"first_speaker": "MACBETH",
"first_text": "Till then, enough. - Come, friends. [Exeunt.]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Inverness]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Inverness]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[A Room in Macbeth's Castle]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[A Room in Macbeth's Castle]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Enter Lady Macbeth]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Enter Lady Macbeth]",
"first_emotion": "neutral",
"resp_speaker": "LADY MACBETH.",
"resp_text": "\"They met me in the day of success; and I have learned by the perfectest report they have more in them than mortal knowledge. When I burned in desire to question them further, they made themselves air, into which they vanished. Whiles I stood rapt in the wonder of it, came missives from the king, who all-hailed me, 'Thane of Cawdor'; by which title, before, these weird sisters saluted me, and referred me to the coming on of time, with 'Hail, king that shalt be!' This have I thought good to deliver thee, my dearest partner of greatness; that thou mightst not lose the dues of rejoicing, by being ignorant of what greatness is promised thee. Lay it to thy heart, and farewell.\" Glamis thou art, and Cawdor; and shalt be what thou art promised; yet do I fear thy nature; It is too full o' the milk of human kindness to catch the nearest way: thou wouldst be great; art not without ambition; but without the illness that should attend it. What thou wouldst highly, that wouldst thou holily; wouldst not play false, and yet wouldst wrongly win. Hie thee hither, that I may pour my spirits in thine ear! [Enter Angus.] What is your tidings?",
"resp_emotion": "anger"
@ -371,6 +427,22 @@
"first_speaker": "LADY MACBETH.",
"first_text": "Only look up clear; to alter favor ever is to fear: Leave all the rest to me. [Exeunt.]",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[The same]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[The same]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Before the castle]",
"resp_emotion": "fear"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Before the castle]",
"first_emotion": "fear",
"resp_speaker": "DUNCAN",
"resp_text": "This castle hath a pleasant seat: the air nimbly and sweetly recommends itself unto our gentle senses. [Enter Lady Macbeth.]",
"resp_emotion": "joy"
@ -483,6 +555,30 @@
"first_speaker": "MACBETH",
"first_text": "I am settled, and bend up each corporal agent to this terrible feat. Away, and mock the time with fairest show: False face must hide what the false heart doth know. [",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Inverness]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Inverness]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[The court before the castle]",
"resp_emotion": "disgust"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[The court before the castle]",
"first_emotion": "disgust",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Enter Banquo]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Enter Banquo]",
"first_emotion": "neutral",
"resp_speaker": "BANQUO",
"resp_text": "A heavy summons lies like lead upon me, and yet I would not sleep: - merciful powers, Restrain in me the cursed thoughts that nature gives way to in repose! Who's there?",
"resp_emotion": "neutral"
@ -732,13 +828,333 @@
"first_text": "My hands are of your color, but I shame to wear a heart so white. [Knocking within.] I hear knocking at the south entry: - let us retire to our chamber. A little water clears us of this deed: How easy is it then! Your constancy Hath abandoned you. - [Knocking within.] Hark, more knocking: Get on your nightgown: - be not lost so poorly in your thoughts.",
"first_emotion": "neutral",
"resp_speaker": "MACBETH",
"resp_text": "To know my deed, 'twere best not know myself. [ Knocking within.] Wake Duncan with thy knocking! I would thou couldst! [Exeunt].",
"resp_text": "To know my deed, 'twere best not know myself. [ Knocking within.] Wake Duncan with thy knocking! I would thou couldst! [Exeunt Lady Macbeth].",
"resp_emotion": "fear"
},
{
"first_speaker": "MACBETH",
"first_text": "To know my deed, 'twere best not know myself. [ Knocking within.] Wake Duncan with thy knocking! I would thou couldst! [Exeunt Lady Macbeth].",
"first_emotion": "fear",
"resp_speaker": "LENNOX",
"resp_text": "Good morrow, noble sir.",
"resp_emotion": "anger"
},
{
"first_speaker": "LENNOX",
"first_text": "Good morrow, noble sir.",
"first_emotion": "anger",
"resp_speaker": "MACBETH",
"resp_text": "Good morrow, both.",
"resp_emotion": "anger"
},
{
"first_speaker": "MACBETH",
"first_text": "Good morrow, both.",
"first_emotion": "anger",
"resp_speaker": "MACDUFF",
"resp_text": "Is the King stirring, worthy thane?",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACDUFF",
"first_text": "Is the King stirring, worthy thane?",
"first_emotion": "neutral",
"resp_speaker": "MACBETH",
"resp_text": "Not yet.",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACBETH",
"first_text": "Not yet.",
"first_emotion": "neutral",
"resp_speaker": "MACDUFF",
"resp_text": "He did command me to call timely on him. I have almost slipped the hour.",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACDUFF",
"first_text": "He did command me to call timely on him. I have almost slipped the hour.",
"first_emotion": "neutral",
"resp_speaker": "MACBETH",
"resp_text": "I’ll bring you to him.",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACBETH",
"first_text": "I’ll bring you to him.",
"first_emotion": "neutral",
"resp_speaker": "MACDUFF",
"resp_text": "I know this is a joyful trouble to you, But yet ’tis one.",
"resp_emotion": "joy"
},
{
"first_speaker": "MACDUFF",
"first_text": "I know this is a joyful trouble to you, But yet ’tis one.",
"first_emotion": "joy",
"resp_speaker": "MACBETH",
"resp_text": "The labor we delight in physics pain. This is the door.",
"resp_emotion": "joy"
},
{
"first_speaker": "MACBETH",
"first_text": "The labor we delight in physics pain. This is the door.",
"first_emotion": "joy",
"resp_speaker": "MACDUFF",
"resp_text": "I’ll make so bold to call, For ’tis my limited service. [Exuent]",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACDUFF",
"first_text": "I’ll make so bold to call, For ’tis my limited service. [Exuent]",
"first_emotion": "neutral",
"resp_speaker": "LENNOX",
"resp_text": "Goes the King hence today?",
"resp_emotion": "neutral"
},
{
"first_speaker": "LENNOX",
"first_text": "Goes the King hence today?",
"first_emotion": "neutral",
"resp_speaker": "MACBETH",
"resp_text": "He does. He did appoint so.",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACBETH",
"first_text": "He does. He did appoint so.",
"first_emotion": "neutral",
"resp_speaker": "LENNOX",
"resp_text": "The night has been unruly. Where we lay, Our chimneys were blown down and, as they say, Lamentings heard i’ th’ air, strange screams of death, And prophesying, with accents terrible, Of dire combustion and confused events New hatched to th’ woeful time. The obscure bird Clamored the livelong night. Some say the Earth Was feverous and did shake.",
"resp_emotion": "fear"
},
{
"first_speaker": "LENNOX",
"first_text": "The night has been unruly. Where we lay, Our chimneys were blown down and, as they say, Lamentings heard i’ th’ air, strange screams of death, And prophesying, with accents terrible, Of dire combustion and confused events New hatched to th’ woeful time. The obscure bird Clamored the livelong night. Some say the Earth Was feverous and did shake.",
"first_emotion": "fear",
"resp_speaker": "MACBETH",
"resp_text": "’Twas a rough night.",
"resp_emotion": "sadness"
},
{
"first_speaker": "MACBETH",
"first_text": "To know my deed, 'twere best not know myself. [ Knocking within.] Wake Duncan with thy knocking! I would thou couldst! [Exeunt].",
"first_text": "’Twas a rough night.",
"first_emotion": "sadness",
"resp_speaker": "LENNOX",
"resp_text": "My young remembrance cannot parallel A fellow to it. [Enter Macduff]",
"resp_emotion": "neutral"
},
{
"first_speaker": "LENNOX",
"first_text": "My young remembrance cannot parallel A fellow to it. [Enter Macduff]",
"first_emotion": "neutral",
"resp_speaker": "MACDUFF",
"resp_text": "O horror, horror, horror! Tongue nor heart cannot conceive nor name thee!",
"resp_emotion": "fear"
},
{
"first_speaker": "MACDUFF",
"first_text": "O horror, horror, horror! Tongue nor heart cannot conceive nor name thee!",
"first_emotion": "fear",
"resp_speaker": "MACBETH AND LENNOX",
"resp_text": "What’s the matter?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MACBETH AND LENNOX",
"first_text": "What’s the matter?",
"first_emotion": "surprise",
"resp_speaker": "MACDUFF",
"resp_text": "Confusion now hath made his masterpiece. Most sacrilegious murder hath broke ope The Lord’s anointed temple and stole thence The life o’ th’ building.",
"resp_emotion": "disgust"
},
{
"first_speaker": "MACDUFF",
"first_text": "Confusion now hath made his masterpiece. Most sacrilegious murder hath broke ope The Lord’s anointed temple and stole thence The life o’ th’ building.",
"first_emotion": "disgust",
"resp_speaker": "MACBETH",
"resp_text": "What is ’t you say? The life?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MACBETH",
"first_text": "What is ’t you say? The life?",
"first_emotion": "surprise",
"resp_speaker": "LENNOX",
"resp_text": "Mean you his Majesty?",
"resp_emotion": "surprise"
},
{
"first_speaker": "LENNOX",
"first_text": "Mean you his Majesty?",
"first_emotion": "surprise",
"resp_speaker": "MACDUFF",
"resp_text": "Approach the chamber and destroy your sight With a new Gorgon. Do not bid me speak. See and then speak yourselves. [Macbeth and Lennox exit] Awake, awake! Ring the alarum bell.—Murder and treason! Banquo and Malcolm, awake! Shake off this downy sleep, death’s counterfeit, And look on death itself. Up, up, and see The great doom’s image. Malcolm, Banquo, As from your graves rise up and walk like sprites To countenance this horror.—Ring the bell. [enter Lady Macbeth]",
"resp_emotion": "fear"
},
{
"first_speaker": "MACDUFF",
"first_text": "Approach the chamber and destroy your sight With a new Gorgon. Do not bid me speak. See and then speak yourselves. [Macbeth and Lennox exit] Awake, awake! Ring the alarum bell.—Murder and treason! Banquo and Malcolm, awake! Shake off this downy sleep, death’s counterfeit, And look on death itself. Up, up, and see The great doom’s image. Malcolm, Banquo, As from your graves rise up and walk like sprites To countenance this horror.—Ring the bell. [enter Lady Macbeth]",
"first_emotion": "fear",
"resp_speaker": "LADY MACBETH",
"resp_text": "What’s the business, That such a hideous trumpet calls to parley The sleepers of the house? Speak, speak!",
"resp_emotion": "disgust"
},
{
"first_speaker": "LADY MACBETH",
"first_text": "What’s the business, That such a hideous trumpet calls to parley The sleepers of the house? Speak, speak!",
"first_emotion": "disgust",
"resp_speaker": "MACDUFF",
"resp_text": "O gentle lady, ’Tis not for you to hear what I can speak. The repetition in a woman’s ear Would murder as it fell. [Enter Banquo] O Banquo, Banquo, Our royal master’s murdered.",
"resp_emotion": "disgust"
},
{
"first_speaker": "MACDUFF",
"first_text": "O gentle lady, ’Tis not for you to hear what I can speak. The repetition in a woman’s ear Would murder as it fell. [Enter Banquo] O Banquo, Banquo, Our royal master’s murdered.",
"first_emotion": "disgust",
"resp_speaker": "LADY MACBETH",
"resp_text": "Woe, alas! What, in our house?",
"resp_emotion": "surprise"
},
{
"first_speaker": "LADY MACBETH",
"first_text": "Woe, alas! What, in our house?",
"first_emotion": "surprise",
"resp_speaker": "BANQUO",
"resp_text": "Too cruel anywhere.— Dear Duff, I prithee, contradict thyself And say it is not so. [Enter Macbeth and Lennox]",
"resp_emotion": "anger"
},
{
"first_speaker": "BANQUO",
"first_text": "Too cruel anywhere.— Dear Duff, I prithee, contradict thyself And say it is not so. [Enter Macbeth and Lennox]",
"first_emotion": "anger",
"resp_speaker": "MACBETH",
"resp_text": "Had I but died an hour before this chance, I had lived a blessèd time; for from this instant There’s nothing serious in mortality. All is but toys. Renown and grace is dead. The wine of life is drawn, and the mere lees Is left this vault to brag of. [Enter Malcolm]",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACBETH",
"first_text": "Had I but died an hour before this chance, I had lived a blessèd time; for from this instant There’s nothing serious in mortality. All is but toys. Renown and grace is dead. The wine of life is drawn, and the mere lees Is left this vault to brag of. [Enter Malcolm]",
"first_emotion": "neutral",
"resp_speaker": "MALCOLM",
"resp_text": "What is amiss?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MALCOLM",
"first_text": "What is amiss?",
"first_emotion": "surprise",
"resp_speaker": "MACBETH",
"resp_text": "You are, and do not know ’t. The spring, the head, the fountain of your blood Is stopped; the very source of it is stopped.",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACBETH",
"first_text": "You are, and do not know ’t. The spring, the head, the fountain of your blood Is stopped; the very source of it is stopped.",
"first_emotion": "neutral",
"resp_speaker": "MACDUFF",
"resp_text": "Your royal father’s murdered.",
"resp_emotion": "sadness"
},
{
"first_speaker": "MACDUFF",
"first_text": "Your royal father’s murdered.",
"first_emotion": "sadness",
"resp_speaker": "MALCOLM",
"resp_text": "O, by whom?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MALCOLM",
"first_text": "O, by whom?",
"first_emotion": "surprise",
"resp_speaker": "LENNOX",
"resp_text": "Those of his chamber, as it seemed, had done ’t. Their hands and faces were all badged with blood. So were their daggers, which unwiped we found Upon their pillows. They stared and were distracted. No man’s life was to be trusted with them.",
"resp_emotion": "disgust"
},
{
"first_speaker": "LENNOX",
"first_text": "Those of his chamber, as it seemed, had done ’t. Their hands and faces were all badged with blood. So were their daggers, which unwiped we found Upon their pillows. They stared and were distracted. No man’s life was to be trusted with them.",
"first_emotion": "disgust",
"resp_speaker": "MACBETH",
"resp_text": "O, yet I do repent me of my fury, That I did kill them.",
"resp_emotion": "anger"
},
{
"first_speaker": "MACBETH",
"first_text": "O, yet I do repent me of my fury, That I did kill them.",
"first_emotion": "anger",
"resp_speaker": "MACDUFF",
"resp_text": "Wherefore did you so?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MACDUFF",
"first_text": "Wherefore did you so?",
"first_emotion": "surprise",
"resp_speaker": "MACBETH",
"resp_text": "Who can be wise, amazed, temp’rate, and furious, Loyal, and neutral, in a moment? No man. Th’ expedition of my violent love Outrun the pauser, reason. Here lay Duncan, His silver skin laced with his golden blood, And his gashed stabs looked like a breach in nature For ruin’s wasteful entrance; there the murderers, Steeped in the colors of their trade, their daggers Unmannerly breeched with gore. Who could refrain That had a heart to love, and in that heart Courage to make ’s love known?",
"resp_emotion": "surprise"
},
{
"first_speaker": "MACBETH",
"first_text": "Who can be wise, amazed, temp’rate, and furious, Loyal, and neutral, in a moment? No man. Th’ expedition of my violent love Outrun the pauser, reason. Here lay Duncan, His silver skin laced with his golden blood, And his gashed stabs looked like a breach in nature For ruin’s wasteful entrance; there the murderers, Steeped in the colors of their trade, their daggers Unmannerly breeched with gore. Who could refrain That had a heart to love, and in that heart Courage to make ’s love known?",
"first_emotion": "surprise",
"resp_speaker": "LADY MACBETH",
"resp_text": "Help me hence, ho!",
"resp_emotion": "anger"
},
{
"first_speaker": "LADY MACBETH",
"first_text": "Help me hence, ho!",
"first_emotion": "anger",
"resp_speaker": "MACDUFF",
"resp_text": "Look to the lady.",
"resp_emotion": "disgust"
},
{
"first_speaker": "MACDUFF",
"first_text": "Look to the lady.",
"first_emotion": "disgust",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Exeunt Macduff, Macbeth, Lady Macbeth, Banquo and Lennox",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Exeunt Macduff, Macbeth, Lady Macbeth, Banquo and Lennox",
"first_emotion": "neutral",
"resp_speaker": "MALCOLM",
"resp_text": "Why do I hold my tongue, That most may claim this argument for mine? What should be spoken here, where my fate, Hid in an auger hole, may rush and seize me? I will away. My tears are not yet brewed. To show an unfelt sorrow is an office Which the false man does easy. I’ll to England. Where I am, There’s daggers in men’s smiles. The near in blood, The nearer bloody. This murderous shaft that’s shot Hath not yet lighted, and my safest way Is to avoid the aim. Therefore to horse, And let me not be dainty of leave-taking But shift away. There’s warrant in that theft Which steals itself when there’s no mercy left.",
"resp_emotion": "fear"
},
{
"first_speaker": "MALCOLM",
"first_text": "Why do I hold my tongue, That most may claim this argument for mine? What should be spoken here, where my fate, Hid in an auger hole, may rush and seize me? I will away. My tears are not yet brewed. To show an unfelt sorrow is an office Which the false man does easy. I’ll to England. Where I am, There’s daggers in men’s smiles. The near in blood, The nearer bloody. This murderous shaft that’s shot Hath not yet lighted, and my safest way Is to avoid the aim. Therefore to horse, And let me not be dainty of leave-taking But shift away. There’s warrant in that theft Which steals itself when there’s no mercy left.",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Forres]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Forres]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[A room within the castle]",
"resp_emotion": "fear"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[A room within the castle]",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Enter Banquo]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Enter Banquo]",
"first_emotion": "neutral",
"resp_speaker": "BANQUO",
"resp_text": "Thou hast it now, - king, Cawdor, Glamis, all, as the weird women promis'd; and, I fear, thou play'dst most foully for't; yet it was said it should not stand in thy posterity; But that I myself should be the root and father of many kings. If there come truth from them, may they not be my oracles as well? But hush; no more. [Enter Macbeth as King, Lady Macbeth as Queen; Lennox, Angus, Lords, Ladies, and Attendants.]",
"resp_emotion": "fear"
@ -1164,21 +1580,45 @@
"first_text": "You lack the season of all natures, sleep.",
"first_emotion": "neutral",
"resp_speaker": "MACBETH.",
"resp_text": "Come, we'll to sleep. My strange and self-abuse is the initiate fear that wants hard use: - We are yet but young in deed.",
"resp_text": "Come, we'll to sleep. My strange and self-abuse is the initiate fear that wants hard use: - We are yet but young in deed. [Exuent]",
"resp_emotion": "fear"
},
{
"first_speaker": "MACBETH.",
"first_text": "Come, we'll to sleep. My strange and self-abuse is the initiate fear that wants hard use: - We are yet but young in deed.",
"first_text": "Come, we'll to sleep. My strange and self-abuse is the initiate fear that wants hard use: - We are yet but young in deed. [Exuent]",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[England]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[England]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Before the castle]",
"resp_emotion": "fear"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Before the castle]",
"first_emotion": "fear",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Enter Malcolm and Macduff]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Enter Malcolm and Macduff]",
"first_emotion": "neutral",
"resp_speaker": "MACDUFF",
"resp_text": "See, who comes here?",
"resp_emotion": "surprise"
"resp_text": "See, who comes here? [Enter Lennox]",
"resp_emotion": "neutral"
},
{
"first_speaker": "MACDUFF",
"first_text": "See, who comes here?",
"first_emotion": "surprise",
"first_text": "See, who comes here? [Enter Lennox]",
"first_emotion": "neutral",
"resp_speaker": "LENNOX",
"resp_text": "My ever-gentle cousin, welcome hither.",
"resp_emotion": "joy"
@ -1356,12 +1796,12 @@
"first_text": "O, gentle heavens, cut short all intermission; bring thou this fiend of Scotland within my sword's length; if he 'scape, Heaven forgive him too!",
"first_emotion": "anger",
"resp_speaker": "MALCOLM",
"resp_text": "This tune goes manly. Come, go we to the king; our power is ready: Macbeth Is ripe for shaking.",
"resp_text": "This tune goes manly. Come, go we to the king; our power is ready: Macbeth Is ripe for shaking. [Exuent]",
"resp_emotion": "fear"
},
{
"first_speaker": "MALCOLM",
"first_text": "This tune goes manly. Come, go we to the king; our power is ready: Macbeth Is ripe for shaking.",
"first_text": "This tune goes manly. Come, go we to the king; our power is ready: Macbeth Is ripe for shaking. [Exuent]",
"first_emotion": "fear",
"resp_speaker": "DOCTOR",
"resp_text": "I have two nights watched with you, but can perceive no truth in your report. When was it she last walked?",
@ -1691,6 +2131,22 @@
"first_speaker": "DOCTOR",
"first_text": "Were I from Dunsinane away and clear, Profit again should hardly draw me here. [Exit.]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[Dunsinane]",
"resp_emotion": "neutral"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[Dunsinane]",
"first_emotion": "neutral",
"resp_speaker": "STAGE DIRECTION",
"resp_text": "[A room within the castle]",
"resp_emotion": "fear"
},
{
"first_speaker": "STAGE DIRECTION",
"first_text": "[A room within the castle]",
"first_emotion": "fear",
"resp_speaker": "MACBETH",
"resp_text": "Hang out our banners on the outward walls. Our castle's strength will laugh a siege to scorn: here let them lie till famine and the ague eat them up: [A cry of women within.] What is that noise?",
"resp_emotion": "anger"

4
src/ofTeleprompter.h

@ -55,7 +55,7 @@ class ofTeleprompter: public ofBaseApp{
std::vector<Line> script;
std::vector<Line> scriptContemporary;
std::string filePath = "text/preprocess_original.json";
std::string filePathContemp = "text/contemp-macbeth.json";
std::string filePathContemp = "text/preprocess_contemporary.json";
int currentLine = 0;
std::string currentLineString = "N/A";
const char* emotions[7] = {"anger", "disgust", "fear", "excited", "bored", "upset", "interested"};
@ -65,7 +65,7 @@ class ofTeleprompter: public ofBaseApp{
int currentLetterIndex = 0;
std::string currentSentence;
uint64_t lastWordTime = 0;
uint64_t wordDelay = 40;
uint64_t wordDelay = 20;
std::string displayedSentence;
ofTrueTypeFont textFont;
ofTrueTypeFont detailsFont;

8
src/onxProcess.cpp

@ -90,12 +90,12 @@ void onxProcess::updateEmotions() {
// Makes sure I do not exceed batchsize, even if more faces are detected
for(size_t i = 0; i < detectedFaces.size() && i < inputImagesFer.size(); i++) {
Emotion emotion;
emotion.anger = tensor[i * 7];
emotion.disgust = tensor[i * 7 + 1];
emotion.fear = tensor[i * 7 + 2];
emotion.anger = tensor[i * 7] * emotionalWeight;
emotion.disgust = tensor[i * 7 + 1] * emotionalWeight;
emotion.fear = tensor[i * 7 + 2] * emotionalWeight;
emotion.happiness = tensor[i * 7 + 3];
emotion.neutral = tensor[i * 7 + 4];
emotion.sadness = tensor[i * 7 + 5];
emotion.sadness = tensor[i * 7 + 5] * emotionalWeight;
emotion.surprise = tensor[i * 7 + 6];
// Normalises values between 0-1

1
src/onxProcess.h

@ -48,4 +48,5 @@ public:
float highestEmotionIntensity = 0;
std::string dominantEmotion = "n/a";
float emotionalWeight = 1.5;
};
Loading…
Cancel
Save