Unearthing Insights through Text Analysis with AI
![Author](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F27n1nnfh%2Fproduction%2Fb91ce5ac8bb91e4e214132694dbaf9f93a833a68-512x512.png&w=48&q=75)
by Rhiaan Jhaveri on Jun 17th, 2023
![Unearthing Insights through Text Analysis with AI](https://cdn.sanity.io/images/27n1nnfh/production/769df09c1c5bd2475759699de38d5516d31e3ec3-2240x1260.png?fit=scale&auto=format)
Introduction
Welcome back to this weekly series on leveraging AI to improve multiple aspects of life, in which I will be focusing on uses for fitness. As we step into week 2 of our 10-part journey, we delve into the exciting world of text analysis. In the realm of AI, text analysis signifies the application of advanced computer systems to comprehend human-written text, deriving actionable insights for business and personal growth. A key application of this technique is sentiment analysis, where AI sifts through a sea of text data from platforms like Twitter, categorizes public opinions, and computes metrics to gauge the positivity or negativity of the text—an intriguing process often referred to as opinion mining.
In this week's article, we'll harness the potential of well-crafted prompts to conduct sentiment analysis using ChatGPT, one of the leading AI models for natural language understanding and generation. Coupling this with categorization, we aim to empower you with a tool that swiftly evaluates the worthiness of fitness elements—be it a cutting-edge fitness tracker, an innovative workout regime, or a trending diet—saving your valuable time and enhancing your fitness decisions.
How does text analysis work?
Before using generative AI prompts for anything, it is helpful to have a fundamental understanding of how text analysis works in large language models (LLMs). Here's a simplified look at this process:
1. Data Collection and Preprocessing
This is where the model ingests raw text data from a diverse range of sources. Preprocessing involves cleaning the data to remove irrelevant information and convert it into a format the model can understand.
2. Tokenization
The cleaned-up text is then broken down into smaller units called "tokens", which can be as small as a single word or as large as a sentence, depending on the model.
3. Feature Extraction
The tokens are then analyzed to identify and extract meaningful features. This could involve understanding the context in which a word is used, identifying the subject of a sentence, or assessing the overall sentiment of a paragraph.
4. Model Training
The model is then trained on these extracted features, learning how different elements interact and relate to each other. It refines its understanding over time through a process called machine learning, improving its ability to accurately analyze new, unseen text.
5. Text Analysis
Once the model is trained, it can be used to analyze text. You can ask it to perform a variety of tasks, such as categorization, sentiment analysis, error detection, and more.
Uses of text analysis
Sentiment analysis
You can use ChatGPT to analyze the sentiment of fitness product reviews. With a prompt like "Analyze the sentiment of the following fitness product review,” ChatGPT can offer insights into how customers perceive a product, thus helping you decide whether to invest in it.
We will now try sentiment analysis with ChatGPT. The following excerpt is from a review of fitness trackers from this website.
The Fitbit Charge 5 is Fitbit's latest tracker and it has a number of exciting features, usually reserved for Fitbit's more expensive trackers, an ECG heart rate monitor being one. During testing, we found that the bright, always-on color touch screen was a massive improvement on the Fitbit Charge 4 — it is easy to read in bright sunlight and is great to use during a HIIT workout or on a hike, although we found the lack of physical buttons made it a little fiddly to navigate around when running.
The Fitbit Charge 5 will also be able to give wearers a "Daily Readiness Score", which is based on three different metrics — fitness fatigue (activity), heart rate variability (HRV), and recent sleep.
If you're looking for a tracker that looks beautiful against your wrist, is easy to read in the bright sunlight and has some impressive features for the price tag, this is a good buy. Also, if you're using a Fitbit Charge 3 or older, the upgrade is worth it for the color screen alone.
The Fitbit Charge 5 won the best fitness tracker award in our 2022 Tom's Guide awards, as it looks cool enough on the wrist that you don’t mind wearing it all day long thanks to the color OLED screen, and has a number of high-spec fitness tracking features.
We will now input this text into this template prompt for sentiment analysis I made with LowTech AI. Add the topic of the text as well.
![](https://cdn.sanity.io/images/27n1nnfh/production/5ade26a7dededb056719919c7f0c8559a3e42bb7-1624x742.png?fit=scale&auto=format)
Now simply click 'generate'. Here's a sample output:
![](https://cdn.sanity.io/images/27n1nnfh/production/caf4390abfb9be66b9cd5c383f3ae625b89853d9-1518x832.png?fit=scale&auto=format)
With one simple step, we were able to glean useful insights from our text!
Some other uses are...
Categorization
With a prompt like "From this research paper, provide a % breakdown of how much…” you can analyze complex datasets. For instance, you could break down fitness regimens by how much they emphasize different elements like strength training, cardio, flexibility, and balance. This is particularly useful when comparing workout plans or understanding research.
Question-Answering
Given a piece of text and a few related questions, ChatGPT can answer these queries accurately. This is useful for gleaning insights from articles, reports, or research papers in the fitness domain without reading the entire document.
Best Practices
Optimizing your use of AI for text analysis involves a few key strategies:
- Use Delimiters for Large Articles: If you're dealing with a section of context, separating it from your instructions using delimiters like {{{three curly brackets}}} can help improve the accuracy of the analysis.
- Ask for Structured Output: If you need to analyze a large amount of data, asking ChatGPT for a structured output (like the table in the prompt used above) can make the information easier to interpret and use.
- Include Style Information: If you need the output in a particular style or tone, include this information in the prompt. ChatGPT can adapt its output to a wide range of styles.
- Iterate Your Prompts: You might not get the perfect result on your first try. Be ready to iterate your prompts based on the outputs you receive.
- Give Examples of Good Outputs: Providing examples of the kind of output you want can guide the model to produce similar results.
If you don't feel like doing all of this but still want useful, fine-tuned prompts, click here. As AI researchers at LowTech, we are creating a curated collection of community-ranked prompts that you can use for any of your needs.