Skip to content

harika-majji/network_security_bot

Repository files navigation

Welcome to Network Security Bot

Project Description

Build or develop a quiz bot based on a network security course using the open-source alternatives to ChatGPT that can be run on any local machine. As data privacy can be compromised when sending data over the internet, it is mandatory to keep it on local system. The bot offers two types of questions: randomly generated questions and specific topic questions, the answers should be pulled from the network security database. The bot is trained using network security quizzes, lecture slides, network security textbook. The quiz includes multiple-choice questions, true/false questions, and open-ended questions. Finally, the bot will provide feedback on the user's answers if it is correct or not along with the reference source documentation title.

System Architecture

User Input:

The user enters a prompt in the user interface.

Embedding Generation:

The system converts user queries into numerical embeddings, capturing the meaning of the text.

Vector Database Query:

The application sends the generated embedding to the vector database.
The vector database compares the user's embedding with precomputed embeddings of various documents.
It returns a list of documents that are most relevant to the user's prompt based on the similarity of their embeddings to the user's embedding.

Contextual Prompt Creation:

The application creates a new prompt by combining the user's initial prompt with the retrieved documents as context.
This step aims to provide additional information and context to the local Language Model.

Local Language Model Processing (LLM):

The modified prompt, containing both the user's input and relevant context documents, is sent to the local Language Model (LLM).
The LLM processes the contextual prompt and generates a response based on the combined information.
The response includes citations or references from the context documents, demonstrating the sources used to generate the answer.

User Interface Display:

The system presents the response along with citations in the user interface.
Users can view the answer and sources, ensuring transparency and credibility in the information provided.

Video

QuizBot_Video.mp4

Prerequisite

Install python3
Create virtual environment
python3 -m venv venv
./venv/bin/activate - for MAC users
./venv/Scripts/activate - for WINDOWS users

Requirements

*pip install langchain==0.0.274
*pip install gpt4all==1.0.8
*pip install chromadb==0.4.7
*pip install llama-cpp-python==0.1.81
*pip install urllib3==2.0.4
*pip install PyMuPDF==1.23.1
*pip install python-dotenv==1.0.0
*pip install unstructured==0.10.8
*pip install extract-msg==0.45.0
*pip install tabulate==0.9.0
*pip install pandoc==2.3
*pip install pypandoc==1.11
*pip install pypdfcd
*pip install tqdm==4.66.1
*pip install sentence_transformers==2.2.2
*pip install flask

Download the model and create a model folder and add it.

Step by step instructions for executions

• python ingest.py # only once until the db folder is generated with all the training data
• python app.py # execute this command to run the application

Features

Bot will generate random and specific topic quizes from trained datasets based on user requirement.
Bot generates different types of questions in quiz like multiple choice, true or false and open-ended.
Bot will provide feedback as score to user once user completes quiz.
Bot works both as quizbot and chatbot.

Describe training data and data formats

We trained our bot using lecture slides and network security textbook(Network Security Essentials: Applications and Standards sixth edition - by William Stallings)

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •