Skip to content

Nitezio/Godamlah_comp_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

# Godamlah_comp_project  

This is my first AI project using the JamAI base, which I developed for the **GODAMLah Competition 2024**, powered by **DATASONIC**.  

## Project Overview  

ChatGuardAI is a conversational monitoring tool that uses JamAI to detect harmful, toxic, or illegal content in real-time messages. The bot flags inappropriate behavior and provides detailed analysis reports for flagged messages.  

## Features  

- **Harmful Content Detection**: Identifies harmful messages based on analysis through JamAI.  
- **Detailed Reporting**: Generates reports for flagged messages, including labels, severity levels, and explanations.  
- **Customizable Alerts**: Notifies users in real time when harmful content is detected.  
- **JamAI Integration**: Leverages the power of JamAI's table-based processing for enhanced analysis.  

## Key Technologies  

- **JamAI**: For advanced message analysis and classification.  
- **Telegram Bot API**: To provide an interface for real-time interaction.  
- **Python (Asyncio)**: For efficient event handling and integration.  

## Installation  

### Prerequisites  

- Python 3.8 or later installed on your system.  
- A Telegram bot created through [BotFather](https://t.me/BotFather) to get your bot's API key.  
- A JamAI Base account with API key and project ID.  

### Steps  

1. **Clone this repository**:  

   ```bash  
   git clone https://github.com/yourusername/Godamlah_comp_project.git  
   cd Godamlah_comp_project  
  1. Install the required Python dependencies:

    pip install -r requirements.txt  
  2. Set up your JamAI credentials:

    • Open the chatguard_ai.py file.
    • Replace add your JamAI Base api key with your JamAI API key.
    • Replace add your JamAI Base project id with your JamAI project ID.
  3. Set up your Telegram Bot API key:

    • Replace 7348521172:AAFRrJdL1hMXymkW4VeawQJ15HwdeF3VtQc in the chatguard_ai.py file with your Telegram bot's API key.
  4. Run the bot:

    python chatguard_ai.py  
  5. Start interacting with your bot on Telegram. Search for your bot's name in the Telegram app and start a chat.

Commands

  • /start: Sends a welcome message to the user.
  • /givereport: Generates a detailed report of the most recent harmful message flagged by the bot.

JamAI Table Setup

Ensure you have the following table configured in JamAI for processing messages:

  • Table Name: ChatGuardAI_3.0
  • Fields Required:
    • Message (text field for input messages)
    • Label (classification output indicating harmful or not)
    • Level (severity level of the message)
    • Report (detailed analysis or explanation)

Refer to JamAI’s documentation to set up and configure tables properly.

Example Interaction

  1. User sends a message in a Telegram chat.

  2. ChatGuardAI analyzes the message through JamAI.

  3. If harmful content is detected, the bot sends an alert:

    ⚠️ Harmful Message Report:  
    🏷️ Label: Harmful  
    📝 Message: "This is an example of a toxic message."  
    📈 Level: High  
    
    Type /givereport for a detailed analysis.  
    
  4. The user can type /givereport to receive a detailed explanation of why the message was flagged.

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork this repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Make your changes and commit them: git commit -m 'Add feature name'.
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request on GitHub.

License

This project is licensed under the MIT License.

Acknowledgments

  • GODAMLah Competition 2024 by DATASONIC
  • JamAI Base for their powerful NLP and AI tools
  • Telegram API for providing an easy-to-use platform for bot integration
  • Python Asyncio for making efficient event handling possible

### Instructions for Users  

1. **Ensure you have Python 3.8+ installed**:  
   Check your version using:  
   ```bash  
   python --version  
  1. Create a Telegram bot:

    • Go to BotFather in Telegram.
    • Use the /newbot command to create a new bot.
    • Copy the API token provided.
  2. Set up JamAI:

    • Sign up at JamAI Base and create a project.
    • Create a table named ChatGuardAI_3.0 with the required fields.
    • Obtain your API key and project ID.
  3. Run the bot locally:
    After setup, run the bot and start sending messages in Telegram to test the functionality.

  4. Troubleshooting:

    • Ensure all dependencies are installed using pip install -r requirements.txt.
    • Verify your JamAI credentials and Telegram bot API key are correct.
    • Check logs for errors (logging is enabled by default).

About

This is my first AI project using JamAI base which i made for the GODAMLah Competition 2024 powered by DATASONIC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages