Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Intelligent Java Chatbot (Task3)

An intelligent, console-based Java Chatbot utilizing rule-based NLP, string processing, and a modular architecture. Built with Java 17 and Object-Oriented Programming principles.

Features

  • Smart Greetings: Asks for your name and remembers it throughout the conversation.
  • Rule-Based NLP: Cleans up your input and extracts intents using Regular Expressions (Regex).
  • Dynamic Responses:
    • Randomly selects from multiple greetings/goodbyes so it doesn't sound robotic.
    • Fetches live Date & Time.
    • Guesses a fun, random weather condition.
  • FAQ Handling: Answers questions about its identity and creator.
  • Persistent Conversation History: Logs every single chat session (and all messages) to history/chat_log.txt using Java File I/O.

Modular Architecture

  • Main.java: Entry point.
  • ChatBot.java: Orchestrates the main conversation loop.
  • NLPProcessor.java: Cleans text and matches keywords to Intents (e.g., datetime, weather, greeting).
  • ResponseEngine.java: Stores static responses in a HashMap and generates dynamic responses.
  • ConversationHistory.java: Uses BufferedWriter to securely append logs to a text file.

How to Compile & Run

  1. Open your terminal and navigate to the project's root folder Task3.
  2. Move into the src directory:
    cd src
  3. Compile the Java files:
    javac bot/*.java
  4. Run the chatbot:
    java bot.Main

Check out the history/ folder after chatting to see your saved conversation logs!