0
0
LangChainframework~15 mins

Feedback collection and annotation in LangChain - Mini Project: Build & Apply

Choose your learning style9 modes available
Feedback Collection and Annotation
📖 Scenario: You are building a simple feedback system for a website. Users submit feedback messages, and you want to store these messages along with a label that describes the sentiment of the feedback (positive, neutral, or negative).This system will help the website team quickly understand user opinions and improve the site.
🎯 Goal: Create a small database structure to store user feedback messages and their sentiment labels. Then, write code to add new feedback entries and annotate each with a sentiment label.
📋 What You'll Learn
Create a dictionary called feedback_db to store feedback messages as keys and their sentiment labels as values.
Create a variable called new_feedback with the exact string: 'The website is very easy to use'.
Add a new entry to feedback_db using new_feedback as the key and 'positive' as the value.
Add a final entry to feedback_db with the key 'The site is slow' and the value 'negative'.
💡 Why This Matters
🌍 Real World
Collecting and labeling user feedback helps businesses understand customer satisfaction and improve their products or services.
💼 Career
Database skills for storing and managing user-generated content are essential for roles in data analysis, product management, and software development.
Progress0 / 4 steps
1
Create the initial feedback database
Create a dictionary called feedback_db with these exact entries: 'Great service': 'positive', 'Could be better': 'neutral', and 'Not satisfied': 'negative'.
LangChain
Need a hint?

Use curly braces {} to create a dictionary. Each entry should have the feedback message as the key and the sentiment label as the value.

2
Add a new feedback message variable
Create a variable called new_feedback and assign it the string 'The website is very easy to use'.
LangChain
Need a hint?

Use the assignment operator = to assign the string to the variable.

3
Add the new feedback to the database
Add a new entry to feedback_db using new_feedback as the key and 'positive' as the value.
LangChain
Need a hint?

Use square brackets [] to add a new key-value pair to the dictionary.

4
Add a final feedback entry
Add a new entry to feedback_db with the key 'The site is slow' and the value 'negative'.
LangChain
Need a hint?

Use the dictionary key assignment syntax to add the new entry.