Positive sentiment signals favorable emotions or opinions about a product, service, or experience. In customer reviews, it helps surface what people value and support decisions about products, marketing, and delivery. section 5.5.3 section 6.2.1
Portuguese review terms that can indicate positive sentiment include:
- Excelente, ótimo, maravilhoso, incrível, fantástico, and perfeito. section 5.5.3
- Bom, eficiente, durável, confiável, rápido, and custo-benefício. section 5.5.3
- Recomendo, satisfeito, confortável, fácil de usar, funcional, melhor, and vale a pena. section 5.5.3
Generate a searchable keyword set
Ask an AI assistant to generate 20 keywords indicating positive sentiment for Portuguese customer reviews, optionally requesting English translations. Inspect the returned list before using it: words can change meaning with context, inflections, and contractions. section 5.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())
Use the Python example to request positive-sentiment keywords through the OpenAI client, then split the response into searchable lines and check failures. section 5.5.3
Treat keyword matching as a practical starting point rather than complete analysis: simple sentiment analysis commonly separates positive, negative, and neutral text, while emotion or aspect-based analysis can provide finer detail. section 5.5.3 section 6.2.1
