Manual evaluation means examining data or generated output yourself to find unusual values, incorrect entries, inconsistent formatting, or incomplete results. It remains essential when automated checks cannot reliably interpret context. section 2.5.3 section 5.5.3
Use manual evaluation to:
- Review suspicious values after frequency checks such as value_counts(). section 2.5.3
- Compare unusual records with domain knowledge before correcting them. section 2.5.3
- Check whether generated lists follow the requested format and contain the intended number of items. section 5.5.3
A suspicious transaction
If nearly every transaction comes from New York and one comes from Los Angeles, inspect that record rather than automatically deleting it. The value may be an entry error or an important exception. Depending on the context, accept, remove, cap, or transform the outlier. section 2.5.3
Listing 5.5 Generating keywords via ChatGPT API
from openai import OpenAI
def generate_keywords(temperature=0.5, max_tokens=150):
client = OpenAI(
api_key="your_api_key", # Make sure to use your actual API key here
)
prompt = """Generate a list of 20 keywords indicating positive
sentiment to be used for searching customer reviews in Portuguese."""
try:
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": prompt,
}
],
model="gpt-4-0125-preview", # Replace with the model you have
access to
temperature=temperature,
max_tokens=max_tokens,
)
return(response.choices[0].message.content.split("\n"))
except Exception as e:
print(f"An error occurred: {str(e)}")
# Example usage
print("Generated Keywords:")
print(generate_keywords())
Inspect the Python API workflow that generates Portuguese positive-sentiment keywords, then verify the response format, length, and repeatability manually. section 5.5.3


