File size: 3,513 Bytes
d71e7b7
c0b9598
d71e7b7
 
 
 
 
 
 
 
 
f69c84e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
title: Solo Project
emoji: 💬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 4.36.1
app_file: app.py
pinned: false
---

An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).

# AI-Driven Content Generation and Moderation Bot

## Overview

This project provides an AI-driven content generation and moderation system for a social media platform. The system generates engaging content based on user inputs and moderates user-generated content to ensure compliance with community guidelines. It utilizes Generative AI models and moderation algorithms to deliver a seamless experience.

## Features

- **Content Generation**: Create posts based on user prompts.
- **Content Moderation**: Detect and filter inappropriate or harmful content.
- **Image Generation**: Create images based on user descriptions.
- **Image Moderation**: Classify and moderate images.
- **Interactive Interface**: User-friendly web interface using Gradio for generating and moderating content.

## Prerequisites

Ensure you have the following installed:

- Python 3.7+
- Pip (Python package installer)
- Virtual Environment (optional but recommended)

## Installation

1. **Clone the Repository**

   ```bash
   git clone https://github.com/karwanjiru/solo-project
   cd solo-project
   ```

2. **Set Up a Virtual Environment** (Optional but recommended)

   ```bash
   python -m venv venv
   source venv/bin/activate  
   On Windows use
   `venv\Scripts\activate`
   ```

3. **Install Dependencies**

   ```bash
   pip install -r requirements.txt
   ```

## Running the Application

1. **Start the Application**

   Run the application using the following command:

   ```bash
   python app.py
   ```

   This will launch a Gradio interface in your default web browser.

2. **Access the Web Interface**

   Open your web browser and navigate to `http://localhost:7860` (or the URL provided in the terminal) to access the Gradio interface.

## Usage

### **Content Generation**

- Navigate to the "Generate Post" tab in the Gradio interface.
- Enter a prompt in the "Post Prompt" textbox.
- Adjust parameters such as "Max new tokens," "Temperature," and "Top-p" as needed.
- Click "Generate Post" to create a new post based on your prompt.

### **Content Moderation**

- Navigate to the "Moderate Post" tab.
- Enter the content of the post you want to moderate in the "Post Content" textbox.
- Click "Moderate Post" to check if the content adheres to community guidelines.

### **Image Generation**

- Navigate to the "Generate Image" tab.
- Enter a prompt for the image generation in the "Image Prompt" textbox.
- Click "Generate Image" to create a new image based on your prompt.
        ***This may take a while to run***

### **Image Moderation**

- Navigate to the "Moderate Image" tab.
- Upload an image, use web cam or paste from clipboard for moderation.
- Click "Moderate Image" to check if the image adheres to community guidelines.

## Contributing

If you would like to contribute to this project, please fork the repository and create a pull request with your changes. Follow the guidelines outlined in the `CONTRIBUTING.md` file.

## License

This project is licensed under the MIT License. `LICENSE` file for details coming soon.

## Contact

For any questions or support, please contact [Diana Wanjiru](mailto:karwanjiru@gmail.com).

---