Updated community sentiment
This commit is contained in:
@@ -1,3 +1,143 @@
|
||||
# AI-Enhanced Joke Bot v4.0 - Enhanced User Analytics Edition
|
||||
|
||||
Welcome to the AI-Enhanced Joke Bot! This application combines humor with artificial intelligence to deliver jokes and analyze user preferences with detailed analytics.
|
||||
|
||||
## 📋 Project Structure
|
||||
|
||||
```
|
||||
v4.0/
|
||||
├── jokes.py # Main application with enhanced user sentiment tracking and analytics
|
||||
├── jokes.db # SQLite database containing jokes and detailed user sentiments
|
||||
├── clean_sample_data.sql # Clean sample data with user identifiers
|
||||
└── README.md # This file
|
||||
```
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### 1. Run the Application
|
||||
|
||||
Simply run the main application file:
|
||||
|
||||
```bash
|
||||
python jokes.py
|
||||
```
|
||||
|
||||
The application will:
|
||||
- Automatically create the database if it doesn't exist
|
||||
- Add sample data with user identifiers
|
||||
- Prompt you for a username to track your preferences
|
||||
|
||||
## 🔧 Key Features
|
||||
|
||||
### Enhanced User Sentiment Tracking
|
||||
- **User Identification**: Each sentiment rating is linked to a specific user identifier
|
||||
- **Rating History**: Track all jokes you've rated with timestamps
|
||||
- **Personal Favorites**: See which jokes you've specifically liked
|
||||
- **Duplicate Prevention**: Users can update their existing ratings
|
||||
|
||||
### Advanced Analytics
|
||||
- **Community Insights**: See overall sentiment trends and statistics
|
||||
- **User Preference Analysis**: Identify which users have the most positive/negative ratings
|
||||
- **Detailed Breakdowns**: View sentiment distribution for individual jokes
|
||||
- **Popularity Metrics**: Understand which jokes are most liked by the community
|
||||
|
||||
## 🎯 Menu Options
|
||||
|
||||
1. **Get Random Joke**: Receive a joke with community ratings and detailed sentiment breakdown
|
||||
2. **Add New Joke**: Submit your own jokes for community rating
|
||||
3. **View Your Ratings**: See your complete rating history
|
||||
4. **See Your Favorites**: View jokes you've specifically liked
|
||||
5. **Community Analytics**: Access detailed community statistics and user rankings
|
||||
6. **Quit**: Exit the application
|
||||
|
||||
## 📊 Database Schema Enhancements
|
||||
|
||||
The `user_sentiments` table now includes:
|
||||
- `user_identifier`: Links each rating to a specific user
|
||||
- `user_sentiment`: The rating (up/down/neutral)
|
||||
- `created_at`: Timestamp of when the rating was made
|
||||
- Support for updating existing ratings
|
||||
|
||||
## 💡 Usage Examples
|
||||
|
||||
### Getting Started
|
||||
```
|
||||
🤖 Welcome to Joke Bot! 🤖
|
||||
Please enter your username (or press Enter for 'Guest'): JohnDoe
|
||||
👤 Logged in as: JohnDoe
|
||||
```
|
||||
|
||||
### Viewing Detailed Analytics
|
||||
When viewing a joke, you'll see:
|
||||
```
|
||||
🤣 Why don't scientists trust atoms? Because they make up everything!
|
||||
👤 Contributor: ScienceFan
|
||||
👥 Community Rating: 👍 Up (3 votes)
|
||||
🔍 Detailed Breakdown:
|
||||
👍 Up: 2 votes
|
||||
😐 Neutral: 1 votes
|
||||
```
|
||||
|
||||
### Accessing Personal Analytics
|
||||
Option 3 shows your rating history:
|
||||
```
|
||||
📊 Your Joke Ratings History (5 ratings):
|
||||
--------------------------------------------------
|
||||
👍 Why did the scarecrow win an award? He was outstanding in his field!
|
||||
Rated: 2024-01-15 14:30:25
|
||||
|
||||
👎 What do you call a fish with no eyes? Fsh!
|
||||
Rated: 2024-01-15 14:25:10
|
||||
```
|
||||
|
||||
### Community Insights
|
||||
Option 5 provides comprehensive analytics:
|
||||
```
|
||||
📈 COMMUNITY ANALYTICS
|
||||
==============================
|
||||
🏆 Most Positive Users:
|
||||
-------------------------
|
||||
1. ComedyFan: 85.7% positive (6/7 ratings)
|
||||
2. JokeLover: 75.0% positive (3/4 ratings)
|
||||
3. FunnyPerson: 66.7% positive (4/6 ratings)
|
||||
|
||||
📊 Overall Statistics:
|
||||
Total jokes rated: 8
|
||||
Total ratings: 24
|
||||
Community positivity: 62.5%
|
||||
```
|
||||
|
||||
## 🛠️ Technical Improvements
|
||||
|
||||
- **Enhanced Data Model**: User identifiers enable sophisticated analytics
|
||||
- **Better UX**: Session-based user identification for consistent tracking
|
||||
- **Rich Analytics**: Multiple layers of statistical insights
|
||||
- **Data Integrity**: Prevents duplicate ratings while allowing updates
|
||||
|
||||
## 🎉 Benefits of User Identification
|
||||
|
||||
1. **Personalized Experience**: Track your own joke preferences over time
|
||||
2. **Social Insights**: Understand community rating patterns
|
||||
3. **Quality Control**: Identify consistently popular contributors
|
||||
4. **Engagement Metrics**: Measure user participation and preferences
|
||||
5. **Recommendation Potential**: Foundation for future personalized joke recommendations
|
||||
|
||||
Enjoy the enhanced AI-powered humor experience with detailed user analytics!
|
||||
|
||||
# Joke Bot - Enhanced Setup Instructions
|
||||
|
||||
## For Beginners
|
||||
|
||||
### Running the Enhanced Version
|
||||
1. Simply run: `python jokes.py`
|
||||
2. Enter your username when prompted
|
||||
3. Enjoy personalized joke ratings and community analytics!
|
||||
|
||||
The enhanced version automatically handles all database setup and provides rich analytics features right out of the box.
|
||||
```
|
||||
|
||||
## 代码修改建议
|
||||
```
|
||||
# AI-Enhanced Joke Bot v4.0
|
||||
|
||||
Welcome to the AI-Enhanced Joke Bot! This application combines humor with artificial intelligence to deliver jokes and analyze their sentiment.
|
||||
@@ -121,4 +261,75 @@ The application uses two tables:
|
||||
- `jokes`: Contains the joke text, contributor, publication date, and AI-analyzed sentiment
|
||||
- `user_sentiments`: Tracks user ratings for each joke with timestamps
|
||||
|
||||
Enjoy the AI-enhanced humor experience with community feedback!
|
||||
Enjoy the AI-enhanced humor experience with community feedback!
|
||||
|
||||
# Joke Bot - Simple Setup Instructions
|
||||
|
||||
Welcome to the Joke Bot! This is a fun program that tells jokes and lets you rate them. Follow these simple steps to get it working!
|
||||
|
||||
## Simplified Project Structure
|
||||
|
||||
The application now has a minimal structure:
|
||||
```
|
||||
v4.0/
|
||||
├── jokes.py # Complete application with database creation and sample data
|
||||
└── README.md # This file
|
||||
```
|
||||
|
||||
## Step-by-Step Instructions for Beginners
|
||||
|
||||
### Step 1: Open Python IDLE
|
||||
1. Find Python IDLE on your computer (it looks like a blue and white icon)
|
||||
2. Click on it to open it
|
||||
3. When it opens, click on "File" then "New File" to create a new file
|
||||
|
||||
### Step 2: Save Your New File
|
||||
1. In the new file window, click "File" then "Save As..."
|
||||
2. Save the file in your folder and name it `jokes.py`
|
||||
3. Remember where you saved it!
|
||||
|
||||
### Step 3: Get the Code from the Website
|
||||
1. Go to this website: https://gitea.techshare.cc/technolyceum/ai6-m3/src/branch/main/jokes_bot/v4.0
|
||||
2. Look for the `jokes.py` file in the list
|
||||
3. Click on it to see the code
|
||||
4. Select all the code (Ctrl+A on Windows or Cmd+A on Mac)
|
||||
5. Copy it (Ctrl+C on Windows or Cmd+C on Mac)
|
||||
|
||||
### Step 4: Paste the Code
|
||||
1. Go back to your Python IDLE window
|
||||
2. Paste the code you copied (Ctrl+V on Windows or Cmd+V on Mac)
|
||||
3. Click "File" then "Save" to save the code in your file
|
||||
|
||||
### Step 5: Run the Program in PowerShell
|
||||
1. Open PowerShell (on Windows) or Terminal (on Mac)
|
||||
2. Navigate to the folder where you saved your jokes.py file
|
||||
- Type: `cd ` followed by the path to your folder
|
||||
3. Create a virtual environment (this keeps your programs organized):
|
||||
- Type: `python -m venv venv`
|
||||
4. Activate the virtual environment:
|
||||
- On Windows: `venv\Scripts\Activate.ps1`
|
||||
- On Mac: `source venv/bin/activate`
|
||||
5. Run the program:
|
||||
- Type: `python jokes.py`
|
||||
|
||||
### Step 6: Using the Joke Bot
|
||||
1. When the program runs, you'll see a menu with options
|
||||
2. Press "1" to get a random joke
|
||||
3. Press "2" to add your own joke
|
||||
4. Press "3" to quit the program
|
||||
|
||||
## Simple Explanation for New Programmers
|
||||
|
||||
Think of programming like cooking:
|
||||
- The code is like a recipe
|
||||
- Python is like your kitchen tools
|
||||
- The computer is like your kitchen where everything happens
|
||||
|
||||
When you run the Joke Bot:
|
||||
- The program automatically creates a database (like a notebook) to store jokes
|
||||
- If there are no jokes in the notebook, it adds some sample jokes for you
|
||||
- Then it shows you the menu so you can interact with it
|
||||
|
||||
The program is smart enough to handle everything by itself - you don't need to worry about databases or SQL statements. Just run it and enjoy the jokes!
|
||||
|
||||
Have fun with your Joke Bot! 😄
|
||||
|
||||
Reference in New Issue
Block a user