Musings of a dad with too much time on his hands and not enough to do. Wait. Reverse that.

Month: June 2021

Maintaining a Positive Sentiment

For various reasons, companies like to know the emotional dispositions of their customers and, sometimes, their employees. One common way to determine these states is through a technique called Sentiment Analysis.

One challenge with sentiment analysis is simply knowing how to score words, one way or another. Our brains know that the word “happy” is usually associated with a positive sentiment because we have a dictionary of sorts in our brains that associates “happy” to a favorable emotional state. Computers don’t immediately know these associations, so you usually have to supply them such mappings, often in the form of simple lists of words.

Now, suppose you want to maintain the appearance of positivity with an organization with whom you interact–maybe through online reviews, email, chat, or some other written medium. Here’s an idea you can try.

Step 1: Downlist a list of positive words

Positive (and negative) word lists are easily available on the Internet. Here’s one I downloaded.

Step 2: Write some PowerShell to extract some random, positive words you can use in your correspondence

If you’re running Microsoft Windows, you’ll likely have PowerShell installed, which is a convenient tool to parse the file you downloaded and provide back a few random words. Here’s a one-liner I wrote:

((cat c:\positive-words.txt|? {!$_.startswith(';') -and $_.length -gt 0}|get-random -count 3) -join '. ') + '.'|set-clipboard

In this code, I load in the word file into memory and then filter out lines that start with semicolons–in the file I downloaded, the author used semicolons to denote comment lines I need to exclude–and empty lines. Next, I select three random lines as each word is on a new line. Next, I put a period between words. Finally, I send the results to the Windows clipboard for easy pasting into the editor in which you are communicating–email, chat window, etc. The result is something like this:

pleasantly. enthralled. idolize.

But wait, there’s more

The above is great, but to get your words, you’ll have to execute the code in a PowerShell command shell. Who has time for that? How about executing your PowerShell from a batch file? Add the following to a new bat file:

set c="((cat c:\positive-words.txt|? {!$_.startswith(';') -and $_.length -gt 0}|get-random -count 3) -join '. ') + '.'|set-clipboard "
powershell -command %c%

Now, place that bat file on your desktop or in a convenient area where you can double-click on it to get your words easily. Even better: make a shortcut to it with a tool like Slickrun.

Now, you can easily leverage positive words in your correspondence and maintain a positive persona to the watchers.

Oh, the Places You’ll Go!

Looking for a gift for the graduate in your life? Dr. Seuss’s Oh, the Places You’ll Go could be just the ticket. The book is a fantastic pep talk for those preparing to make their marks on the world.

Want to take this gift to the next level? If you’re hosting or participating in a graduation party for your graduate, have all the party attendees sign the book and write an encouraging note or memory in it.

Want to take this gift to the supreme level? Plan ahead: I’m talking months and even years. Every year your child or loved one is in school, make arrangements to have his favorite teachers write notes in the book–on whatever page they choose–and ask that they date their notes, as well. And don’t restrict yourself to just teachers, either: anyone who’s had a positive influence on your child should be included.

If you start this work early enough, you’ll have an amazing and heart-felt gift for your loved one at their graduation, especially if it’s many years away.

© 2024 DadOverflow.com

Theme by Anders NorenUp ↑